//accepted_A
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
 
using namespace std;
typedef long long ll;

char s[10];
int t, i, n, x;

int main(){
	//freopen("in.txt","r",stdin);//freopen("out.txt","w",stdout);
	scanf("%d", &t);
	for(i=0;i<t;++i){
		
		scanf("%s", s);
		n=strlen(s);
		if(n==5)printf("3\n");
		else{
			x=0;
			x+=( s[0]=='o');
			x+=( s[1]=='n');
			x+=( s[2]=='e');
			if(x>1)printf("1\n");
			else printf("2\n");
		}
	}
	
	return 0;
}
